//游戏区交互//////////////////////////////////////////////////////////////////////////////////////
var playerLandIndex;
var playerLandId;
//角色对话框1---------------------------------
//////////////////landState==>>>1未开垦2未种植3成长中5成熟待收割9收割后未翻地/////////////////////////
function playerOperate(landState,index) {
	playerLandIndex = index;//操作索引
	let land = current_player_farm_lands_detail.get('land_'+index);//土地数据
	if(checkEmpty(land)){//判断是否有效
		showPersonalMessage(_game_name_, "请选择一块土地再进行操作");
		return;
	}
	//保存用户选择土地
	playerLandId = land.id;
	//console.log('index==='+index);
	//console.log('current_player_farm_lands_detail==='+current_player_farm_lands_detail);
	//console.log('land==='+land);
	reset_point('playerFarmDiv');
	//操作按钮
	let dom = $('#player_action_btns');
	dom.html('');
		
	let str = '';
	//是否需要开垦
	if(landState<=1){
		$('#player_action_title').html('待开垦');
		str = str + '<span class="player-fight-action" onclick="doPlayerFarmAction(40,\''+playerLandId+'\')">[开垦]</span>';
	}else if(landState==2){
		$('#player_action_title').html('待种植');
		str = str + '<span class="player-fight-action" onclick="doPlayerFarmAction(20,\''+playerLandId+'\')">[播种]</span>';
	}else if(landState==3){
		$('#player_action_title').html(land.cropsName+'未成熟');
		str = str + '<span class="player-fight-action" onclick="doPlayerFarmAction(10,\''+playerLandId+'\')">[翻地]</span>';
		//str = str + '<span class="player-fight-action" onclick="doPlayerFarmAction(20,\''+playerLandId+'\')">[播种]</span>';
		//str = str + '<span class="player-fight-action" onclick="doPlayerFarmAction(30,\''+playerLandId+'\')">[收割]</span>';
		//str = str + '<span class="player-fight-action" onclick="doPlayerFarmAction(40,\''+playerLandId+'\')">[开垦]</span>';
		str = str + '<br>';
		str = str + '<span class="player-fight-action" onclick="doPlayerFarmAction(50,\''+playerLandId+'\')">[浇水]</span>';
		str = str + '<span class="player-fight-action" onclick="doPlayerFarmAction(60,\''+playerLandId+'\')">[施肥]</span>';
		str = str + '<span class="player-fight-action" onclick="doPlayerFarmAction(70,\''+playerLandId+'\')">[除草]</span>';
		str = str + '<span class="player-fight-action" onclick="doPlayerFarmAction(80,\''+playerLandId+'\')">[杀虫]</span>';
	}else if(landState==5){
		$('#player_action_title').html(land.cropsName+'待收割');
		str = str + '<span class="player-fight-action" onclick="doPlayerFarmAction(30,\''+playerLandId+'\')">[收割]</span>';
		str = str + '<span class="player-fight-action" onclick="doPlayerFarmAction(31,\''+playerLandId+'\')">[再种]</span>';
	}else if(landState==9){
		$('#player_action_title').html(land.cropsName+'已收割');
		str = str + '<span class="player-fight-action" onclick="doPlayerFarmAction(10,\''+playerLandId+'\')">[翻地]</span>';
	}else{
		$('#player_action_title').html('待翻地');
		str = str + '<span class="player-fight-action" onclick="doPlayerFarmAction(10,\''+playerLandId+'\')">[翻地]</span>';
	}
	dom.append(str);
	$('#playerFarmDiv').removeClass('dn');
}
